﻿using Swimj.DomainLib.Entities;

namespace BaseData.DomainLib.AggregatesModel.MaterialAggregate
{
    public class Material : AuditableAggregateRoot<int>
    {
        /// <summary>
        /// 物料编码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 物料分类
        /// </summary>
        public int? MaterialType { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string? Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public int? Unit { get; set; }

        public int? Sort { get; set; }

        public string? Description { get; set; }

        public Material()
        {
        }

        public Material(string? code, string? name, int? materialType, string? specification,
            int? unit, int? sort, string? description) : this()
        {
            Code = code;
            Name = name;
            MaterialType = materialType;
            Specification = specification;
            Unit = unit;
            Sort = sort;
            Description = description;
        }

        public void Update(string? code, string? name, int? materialType, string? specification,
            int? unit, int? sort, string? description)
        {
            Code = code;
            Name = name;
            MaterialType = materialType;
            Specification = specification;
            Unit = unit;
            Sort = sort;
            Description = description;
        }
    }
}